04. Case Study: Eureka Server
JAVA C2 L4 04 Demo - Eureka Server
The case study is an online ordering service. There are multiple services that work together to create the system.
- Item Service
- Order Service
- Shipping Service
Each service has its own database. For this case study, instead of building out the entire system, we will focus on the Item Service. The code can be cloned from GitLab.
The project has the following components:
Eureka Module
Items Microservices Module
- CRUD Repository - ItemRepository.java
- Domain Entity/Model -Item.java
- H2 Database accessible via http://localhost:8080/h2/
- Tomcat Server accessible via http://localhost:8080
- Items Microservice accessible via http://localhost:8080/items
Troubleshooting
You may need this additional dependency in your POM file for the Eureka server to load:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.4.0-b180725.0427</version>
</dependency>